home *** CD-ROM | disk | FTP | other *** search
/ Turnbull China Bikeride / Turnbull China Bikeride - Disc 1.iso / ARGONET / PD / MODULES / DSYMPLAY.ZIP / DSymPlayer / DSym_Info next >
Text File  |  1996-10-23  |  57KB  |  1,277 lines

  1. Digital Symphony revisions:
  2. ===========================
  3. 1) 12 Mar 1993 (DS 1.20, DSymPlay 1.01)
  4.    ------------------------------------
  5.    Filetypes SySample and Symphony are now able to store 8-bit linear sample
  6.    data.
  7.  
  8. 2) 30 Mar 1994 (DS 1.30, DSymPlay 1.30)
  9.    ------------------------------------
  10.    Filetypes SySample and Symphony are now able to store 16-bit linear sample
  11.    data.
  12.    New compression scheme introduced.
  13.    We now play tunes at nearly exactly the speed an Am*ga does.
  14.  
  15. 3) 01 Sep 1994 (DS 1.31, DSymPlay 1.30)
  16.    ------------------------------------
  17.  
  18. 4) 16 Jan 1995 (DS 1.31, DSymPlay 1.40)
  19.    ------------------------------------
  20. 5) 23 Oct 1996 (DS 1.31, DSymPlay 1.41)
  21.    ------------------------------------
  22.  
  23. Latest versions:
  24. ================
  25. DSym_Play module: 1.41
  26. Digital Symphony: 1.31
  27. Symphony file: 1 (from DS 1.30 on)
  28. SySample file: 1 (from DS 1.30 on)
  29. Patterns file: 0
  30.  
  31. Major changes in DSymPlay from version 1.10 on:
  32. ===============================================
  33. - Dynamic choice of the fastest routine given the processor (ARM 2 or >2).
  34. - The load routine didn't release the unpacking buffer (32K) after
  35.   loading a packed song. Works now.
  36. - Changed the specs of the CutNote SWI, sorry!
  37. - StrongARM compatible
  38.  
  39.  
  40. This file contains two main parts:
  41. ==================================
  42.  
  43.    I. Effects commands and music files formats.
  44.   II. SWI's and commands of the Digital Symphony players.
  45.  
  46.  
  47.    ======================================================================
  48.    PART I : Effect commands and music file formats of some music programs
  49.    ======================================================================
  50.  
  51. 1.1. Amiga ProTracker V1.1B Effect Commands
  52.      --------------------------------------
  53.      (x-y,z) indicates z is done if value not in the range x to y inclusive.
  54.      <command number in hex> <effect value in hex>
  55.  
  56.      0 xy Normal play or Arpeggio.
  57.           x: first halfnote to add to pitch
  58.           y: second halftone to add to pitch
  59.  
  60.      1 xx Slide Up.
  61.           xx: pitch increase step
  62.  
  63.      2 xx Slide Down.
  64.           xx: pitch decrease step
  65.  
  66.      3 xx Tone Portamento. 
  67.           xx: pitch slide speed (0 for previous speed)
  68.  
  69.      4 xy Vibrato.
  70.           x: pitch change speed (0 for previous speed)
  71.           y: pitch change depth (0 for previous depth)
  72.  
  73.      5 xy Tone Portamento + Volume Slide.
  74.           x: volume increase step (priority)
  75.           y: volume decrease step
  76.  
  77.      6 xy Vibrato + Volume Slide.
  78.           x: volume increase step (priority)
  79.           y: volume decrease step
  80.  
  81.      7 xy Tremolo.
  82.           x: volume change speed (0 for previous speed)
  83.           y: volume change depth (0 for previous depth)
  84.  
  85.      8 xx Not used.
  86.  
  87.      9 xx Set Sample Offset.
  88.           xx: offset in sample DIV 256 (loop restarted if illegal)
  89.               0 for previous offset
  90.  
  91.      A xy Volume Slide.
  92.           x: volume increase step (priority)
  93.           y: volume decrease step
  94.  
  95.      B xx Position Jump.
  96.           xx: song position (0-127, masked, 0 if illegal)
  97.  
  98.      C xx Set Volume.
  99.           xx: volume (0-64,rounded). Linear.
  100.  
  101.      D xy Pattern Break.
  102.           10*x+y: position to jump to in next pattern (0-63, 0)
  103.  
  104.      E 0x Set Filter.
  105.           x: filter on (0) or filter off (1) (or power LED on/off)
  106.  
  107.      E 1x Fine Slide Up.
  108.           x: value to add to pitch
  109.  
  110.      E 2x Fine Slide Down.
  111.           x: value to subtract from pitch
  112.  
  113.      E 3x Glissando Control.
  114.           x: on (1) or off (0) (use with Tone Portamento)
  115.           When off, the slide is smooth else from halfnote to halfnote
  116.  
  117.      E 4x Set Vibrato Waveform.
  118.           x: sine (0), ramp down (1), square (2)
  119.              bit 2 is off if wave form has to be restarted each note
  120.  
  121.      E 5x Set Fine Tune.
  122.           x: new fine tune value
  123.  
  124.      E 6x Jump to Loop.
  125.           x: jump to loop, play x times
  126.              if 0, the loop start is set to the current pattern position
  127.  
  128.      E 7x Set Tremolo Waveform.
  129.           x: sine (0), ramp down (1), square (2)
  130.              bit 2 is off if wave form has to be restarted each note
  131.  
  132.      E 8x Not used.
  133.  
  134.      E 9x Retrig Note.
  135.           x: retrig note each (more or less) x vblanks
  136.  
  137.      E Ax Fine Volume Slide Up.
  138.           x: value to add to volume
  139.  
  140.      E Bx Fine Volume Slide Down.
  141.           x: value to subtract from volume
  142.  
  143.      E Cx Note Cut.
  144.           x: cut note after x vblanks (volume is only set to 0)
  145.  
  146.      E Dx Note Delay.
  147.           x: number of vblanks for note delay
  148.  
  149.      E Ex Pattern Delay.
  150.           x: delay pattern x notes
  151.  
  152.      E Fx Invert Loop.
  153.           x: speed
  154.              if 0, it's turned off
  155.           Care must be taken using it: it inverts the sign of sample data
  156.           inside sample loop, one byte each vblank
  157.  
  158.      F xx Set Speed.
  159.           In CIA mode (recommended and most usual):
  160.               xx: speed (1-31,ignored) or tempo (32-255)
  161.                   Tempo unit: 1/24th vblanks per minute (defaults to 125)
  162.           In VBlank mode:
  163.               xx: speed (1-255,ignored)
  164.  
  165. 1.2. Archimedes Tracker V1.0+++ Effect Commands
  166.      ------------------------------------------                    
  167.      (x-y,z) indicates z is done if value not in the range x to y.
  168.      <command character> <command number in hex> <effect value in hex>
  169.  
  170.      0 00 xy Normal play or Arpeggio.
  171.              x: first halfnote to add
  172.              y: second halftone to subtract
  173.  
  174.      1 01 xx Slide Up.
  175.              xx: pitch increase step (4 bits?)
  176.  
  177.      2 02 xx Slide Down.
  178.              xx: pitch decrease step (4 bits?)
  179.                                          
  180.      B 0B xx Break Pattern.
  181.  
  182.      E 0E xy Set Stereo.
  183.              y: stereo position (1-7,ignored). 1=left 4=center 7=right
  184.              
  185.      G 10 xx Volume Slide Up.
  186.              xx: speed (4 bits?)
  187.  
  188.      H 11 xx Volume Slide Down.
  189.              xx: speed (4 bits?)
  190.  
  191.      J 13 xx Position Jump.
  192.              xx: song position (0-127,masked)
  193.  
  194.      L 15 xy Line Jump. (not in manual)
  195.              Jump to line 10*x+y in same pattern. (10*x+y>63 ignored)
  196.  
  197.      S 1C xy Set Speed.
  198.              y: speed (1-15,ignored)
  199.  
  200.      V 1F xx Set Volume.
  201.              xx: volume (0-255). Logarithmic.
  202.  
  203. 1.3. Archimedes Symphony V1.00 Effect Commands
  204.      -----------------------------------------
  205.      (x-y,z) indicates z is done if value not in the range x to y.
  206.      <command number in hex> <effect value in hex>
  207.  
  208.      00 xyz Normal play or Arpeggio + Volume Slide Up.
  209.             x: volume increase step
  210.             y: first halfnote to add
  211.             z: second halftone to add
  212.  
  213.      01 xyy Slide Up + Volume Slide Up.
  214.             x: volume increase step
  215.             yy: pitch increase step
  216.  
  217.      02 xyy Slide Down + Volume Slide Up.
  218.             x: volume increase step
  219.             yy: pitch decrease step
  220.  
  221.      03 xyy Tone Portamento. 
  222.             yy: pitch slide speed (0 for previous speed)
  223.  
  224.      04 xyz Vibrato.
  225.             y: pitch change speed (0 for previous speed)
  226.             z: pitch change depth (0 for previous depth)
  227.  
  228.      05 xyz Tone Portamento + Volume Slide.
  229.             y: volume increase step (priority)
  230.             z: volume decrease step
  231.  
  232.      06 xyz Vibrato + Volume Slide.
  233.             y: volume increase step (priority)
  234.             z: volume decrease step
  235.  
  236.      07 xyz Tremolo.
  237.             y: volume change speed (0 for previous speed)
  238.             z: volume change depth (0 for previous depth)
  239.  
  240.      09 xxx Set Sample Offset.
  241.             xxx: offset in sample DIV 128 (loop restarted if illegal)
  242.                  0 for previous offset
  243.  
  244.      0A xyz Volume Slide + Fine Slide Up.
  245.             x: value to add to pitch
  246.             y: volume increase step (priority)
  247.             z: volume decrease step
  248.  
  249.      0B xxx Position Jump.
  250.             xxx: song position (0 if illegal)
  251.  
  252.      0C xyy Set Volume.
  253.             yy: volume (0-64,rounded). Linear.
  254.  
  255.      0D xyy Pattern Break.
  256.             yy: break position in next pattern (0-63, 0)
  257.  
  258.      0E xxx Not used.
  259.  
  260.      0F xxx Set Speed.
  261.             xxx: speed (1-4095,ignored). Default is 6
  262.  
  263.      10 xxy Filter Control. (Not implemented)
  264.             y: filter on (0) or filter off (1)
  265.  
  266.      11 xyy Fine Slide Up + Fine Volume Slide Up.
  267.             x: value to add to volume
  268.             yy: value to add to pitch
  269.  
  270.      12 xyy Fine Slide Down + Fine Volume Slide Up.
  271.             x: value to add to volume
  272.             yy: value to subtract from pitch
  273.  
  274.      13 xxy Glissando Control.
  275.             y: on (1) or off (0) (use with Tone Portamento)
  276.             When off, the slide is smooth else from halfnote to halfnote
  277.  
  278.      14 xxy Set Vibrato Waveform.
  279.             y: sine (0), ramp down (1), square (2)
  280.                bit 2 is off if wave form has to be restarted each note
  281.  
  282.      15 xxy Set Fine Tune.
  283.             y: new fine tune value
  284.  
  285.      16 xxx Jump to Loop.
  286.             xxx: jump to loop, play xxx times
  287.                  if 0, the loop start is set to the current pattern position
  288.  
  289.      17 xxy Set Tremolo Waveform.
  290.             y: sine (0), ramp down (1), square (2)
  291.                bit 2 is off if wave form has to be restarted each note
  292.  
  293.      19 xxx Retrig Note.
  294.             xxx: retrig note each (more or less) xxx vblanks
  295.  
  296.      1A xyy Fine Slide Up + Fine Volume Slide Down.
  297.             x: value to subtract from volume
  298.             yy: value to add to pitch
  299.  
  300.      1B xyy Fine Slide Down + Fine Volume Slide Down.
  301.             x: value to subtract from volume
  302.             yy: value to subtract from pitch
  303.  
  304.      1C xxx Note Cut.
  305.             xxx: cut note after xxx vblanks (volume is only set to 0)
  306.  
  307.      1D xxx Note Delay.
  308.             xxx: number of vblanks for note delay
  309.  
  310.      1E xxx Pattern Delay.
  311.             xxx: delay pattern xxx notes
  312.  
  313.      1F xxy Invert Loop.
  314.             y: speed
  315.                if 0, it's turned off
  316.                Care must be taken using it: it inverts the sign of sample
  317.                data inside sample loop, one byte each vblank
  318.  
  319.      20 xyz Normal play or Arpeggio + Volume Slide Down.
  320.             x: volume decrease step
  321.             y: first halfnote to add
  322.             z: second halftone to add
  323.  
  324.      21 xyy Slide Up + Volume Slide Down.
  325.             x: volume decrease step
  326.             yy: pitch increase step
  327.  
  328.      22 xyy Slide Down + Volume Slide Down.
  329.             x: volume decrease step
  330.             yy: pitch decrease step
  331.  
  332.      2A xyz Volume Slide + Fine Slide Down.
  333.             x: value to subtract from pitch
  334.             y: volume increase step (priority)
  335.             z: volume decrease step
  336.  
  337.      2B xyy Line Jump.
  338.             yy: Line to jump to in same pattern. (0-63, 0)
  339.  
  340.      2F xxx Set Tempo.
  341.             xxx: new tempo value (1-4095,ignored).
  342.                  Unit: 1/20th vblanks per second (defaults to 1000)
  343.  
  344.      30 xxy Set Stereo.
  345.             if y and 7 =0 then xx = stereo position (0-127 is 0 to 127,
  346.                                     129-255 is -1 to -127, 128 ignored)
  347.             if y and 7 >0 then y = stereo position (1-7,ignored).
  348.                                1=left 4=center 7=right
  349.  
  350.      31 xxx Song Upcall.
  351.             The CPU performs a linked branch to the song upcall vector.
  352.             The routine linked to that vector can corrupt all registers
  353.             and must preserve SVC mode on return using MOVS PC,R14
  354.             On entry registers contain the following:
  355.             R0= xxx parameter
  356.             R4= full note address + 4
  357.             R5= voice number (0 to 7)
  358.  
  359.      32 xxx Unset Sample Repeat.
  360.             The sample continues to be played until it ends, but without loops
  361.  
  362. 2.1. Amiga ProTracker V1.1B Song/Module Format (Filetype &001)
  363.      ---------------------------------------------------------
  364.      Rem: files handled by Amiga ProTracker, NoiseTracker, SoundTracker,
  365.           IntuiTracker, ...
  366.  
  367.      Offset  Bytes  Description
  368.      ------  -----  -----------
  369.         0     20    Songname. Trailing null bytes at the end.
  370.  
  371.      Information for sample 1-31:
  372.  
  373.      Offset  Bytes  Description
  374.      ------  -----  -----------
  375.        20     22    Samplename. Pad with null bytes.
  376.        42      2    Length DIV 2. 
  377.        44      1    Lower four bits: finetune value (signed 4 bits)
  378.                     Upper four bits: not used (should be 0).
  379.        45      1    Volume for sample 1. Range is &00-&40 (0-64).
  380.        46      2    Repeat offset DIV 2.
  381.        48      2    Repeat length DIV 2.
  382.  
  383.      Information for the next 30 samples starts here. It's just like the
  384.      info for sample 1.
  385.  
  386.      Offset  Bytes  Description
  387.      ------  -----  -----------
  388.        50     30    Sample 2...
  389.        80     30    Sample 3...
  390.         .
  391.         .
  392.         .
  393.       890     30    Sample 30...
  394.       920     30    Sample 31...
  395.  
  396.      Offset  Bytes  Description
  397.      ------  -----  -----------
  398.       950      1    Songlength (1-128).
  399.       951      1    Well... this little byte here is set to 127, so that old
  400.                     trackers will search through all patterns when loading.
  401.                     NoiseTracker uses this byte for restart, but we don't.
  402.       952    128    Song positions 0-127. Each hold a number from 0-63 that
  403.                     tells the tracker what pattern to play at that position.
  404.      1080      4    The four letters "M.K." - This is something
  405.                     Mahoney & Kaktus inserted when they increased the number
  406.                     of samples from 15 to 31. If it's not there, the
  407.                     module/song uses 15 samples or the text has been removed
  408.                     to make the module harder to rip. Startrekker puts
  409.                     "FLT4" or "FLT8" there instead. "M&K!" may be present,
  410.                     too.
  411.  
  412.      Offset  Bytes  Description
  413.      ------  -----  -----------
  414.      1084    1024   Data for pattern 00.
  415.         .
  416.         .
  417.         .
  418.      xxxx  Number of patterns stored is equal to the highest pattern number
  419.            in the song position table (at offset 952-1079).
  420.  
  421.      Each note is stored as 4 bytes, and all four notes at each position in
  422.      the pattern are stored after each other.
  423.  
  424.      Position          Notes data
  425.      -------- ------------------------------ 
  426.         00    chan 1  chan 2  chan 3  chan 4
  427.         01    chan 1  chan 2  chan 3  chan 4
  428.         02    chan 1  chan 2  chan 3  chan 4
  429.        etc.
  430.  
  431.      Info for each note:
  432.      -------------------      
  433.      bits 24-31: effect value (0-255).
  434.           20-23: lower 4 bits of sample number (0-15).
  435.           16-19: effect command number (0-15).
  436.            8-15: lower 8 bits of note period (0-255).
  437.            4- 7: upper 4 bits of sample number (0-1).
  438.            0- 3: higher 4 bits of note period (0-3).
  439.  
  440.      Period table for Tuning 0, normal:
  441.      ----------------------------------
  442.        C-1 to B-1 : 856,808,762,720,678,640,604,570,538,508,480,453
  443.        C-2 to B-2 : 428,404,381,360,339,320,302,285,269,254,240,226
  444.        C-3 to B-3 : 214,202,190,180,170,160,151,143,135,127,120,113
  445.  
  446.      To determine what note to show, scan through the table until you find
  447.      the same period as the one in the note. Use the index to look up in
  448.      a notenames table.
  449.  
  450.      This is the data stored in a normal song. A packed song starts with the
  451.      four letters "PACK".
  452.  
  453.      In a module, all the samples are stored right after the pattern data.
  454.      To determine where a sample starts and stops, you use the sample info
  455.      structures in the beginning of the file (from offset 20). Their format
  456.      is linear signed.
  457.  
  458.      ProTracker CIA (Complex Interface Adapter) Timer Tempo Calculations
  459.                                       AMIGA
  460.      -------------------------------------------------------------------
  461.      Fcolor                        = 4.43361825 MHz (PAL color carrier freq)
  462.      CPU Clock   = Fcolor * 1.6    = 7.0937892  MHz
  463.      CIA Clock   = CPU Clock / 10  = 709.37892  kHz
  464.      50 Hz Timer = CIA Clock / 50  = 14187.5784
  465.      Tempo num.  = 50 Hz Timer*125 = 1773447
  466.  
  467.      For NTSC: CPU Clock = 7.1590905 MHz --> Tempo num. = 1789773
  468.  
  469.       To calculate tempo we use the formula: TimerValue = 1773447 / Tempo
  470.       The timer is only a word, so the available tempo range is 28-255 (++).
  471.       Tempo 125 will give a normal 50 Hz timer (VBlank).
  472.  
  473.       A normal ProTracker VBlank song tempo can be calculated as follows:
  474.       We want to know the tempo in BPM (Beats Per Minute), or rather quarter-
  475.       notes per minute. Four notes makes up a quarternote.
  476.       First find interrupts per minute: 60 seconds * 50 per second = 3000
  477.       Divide by interrupts per quarter note = 4 notes * speed
  478.       This gives: Tempo = 3000/(4*speed)
  479.       Simplified: Tempo = 750/speed
  480.       For a normal song in speed 6 this formula gives: 750/6 = 125 BPM
  481.       
  482.       Note: The mentioned 50 Hz quantities are rather inaccurate since the
  483.             vblank frequency is exactly 49.9 Hz!
  484.  
  485. 2.2. Archimedes Tracker V1.0+++ File Formats
  486.      ---------------------------------------
  487.      
  488.      Sample chunk format
  489.      -------------------
  490.      This is the component of a Tracker sample file (Filetype &CB5).
  491.      
  492.        Field length Contents
  493.        ------------ --------
  494.           4 bytes   The string "SAMP"
  495.           4 bytes   Chunk length (i.e. total size -8)
  496.           4 bytes   The string "SNAM"
  497.           4 bytes   Sample name length (20)
  498.          20 bytes   Sample name padded with zero's
  499.           4 bytes   The string "SVOL"
  500.           4 bytes   Value 4
  501.           4 bytes   Sample volume (0-255). Logarithmic
  502.           4 bytes   The string "SLEN"
  503.           4 bytes   Value 4
  504.           4 bytes   Sample length (multiple of 4 otherwise Tracker crashes!)
  505.           4 bytes   The string "ROFS"
  506.           4 bytes   Value 4
  507.           4 bytes   Repeat offset
  508.           4 bytes   The string "RLEN"
  509.           4 bytes   Value 4
  510.           4 bytes   Repeat length
  511.           4 bytes   The string "SDAT"
  512.           4 bytes   Sample length (multiple of 4): xx
  513.          xx bytes   Sample data in logarithmic format
  514.  
  515.        Note: the manual states that not all sub-chunks may be present. But
  516.              until now they've always been there.
  517.  
  518.      Pattern chunk format
  519.      --------------------
  520.      This is the component of a Tracker pattern file (Filetype &FF1).
  521.      
  522.        Field length Contents
  523.        ------------ --------
  524.           4 bytes   The string "PATT"
  525.           4 bytes   Chunk length (i.e. number of voices * 256 - the manual
  526.                     says it's always 2048, that's false! ): xx
  527.          xx bytes   Notes
  528.  
  529.          Each note is stored as 4 bytes, and all x notes at each position in
  530.          the pattern are stored after each other.
  531.      
  532.          Position         Notes data
  533.          -------- ---------------------------
  534.             00    chan 1  chan 2  ...  chan x
  535.             01    chan 1  chan 2  ...  chan x
  536.             02    chan 1  chan 2  ...  chan x
  537.            etc.
  538.  
  539.          Info for each note:
  540.          -------------------      
  541.          bits 24-31: note number (0-36).
  542.               16-23: sample number (0-36).
  543.                8-15: effect command number.
  544.                0- 7: effect value (0-255).
  545.      
  546.          Note numbers table:
  547.          -------------------
  548.            C-1 to B-1 : 01 to 12
  549.            C-2 to B-2 : 13 to 24
  550.            C-3 to B-3 : 25 to 36
  551.  
  552.      Module format
  553.      -------------
  554.      This is the format of a Tracker module file (Filetype &CB6).
  555.      
  556.        Field length Contents
  557.        ------------ --------
  558.           4 bytes   The string "MUSX"
  559.           4 bytes   Chunk length (i.e. total size -8)
  560.           4 bytes   The string "TINF"
  561.           4 bytes   Value 4
  562.           4 bytes   Date of version in BCD format: YYYYMMDD (bytes 1 to 4)
  563.           4 bytes   The string "MVOX"
  564.           4 bytes   Value 4
  565.           4 bytes   Number of voices (1-8)
  566.           4 bytes   The string "STER"
  567.           4 bytes   Value 8
  568.           8 bytes   Default stereo positions for 8 channels. See the command.
  569.           4 bytes   The string "MNAM"
  570.           4 bytes   Tune name length (32)
  571.          32 bytes   Tune name padded with zero's
  572.           4 bytes   the string "ANAM"
  573.           4 bytes   Author name length (32)
  574.          32 bytes   Author name padded with zero's
  575.           4 bytes   the string "MLEN"
  576.           4 bytes   Value 4
  577.           4 bytes   Tune length (1-128)
  578.           4 bytes   the string "PNUM"
  579.           4 bytes   Value 4
  580.           4 bytes   Number of defined patterns (1-64)
  581.           4 bytes   the string "PLEN"
  582.           4 bytes   Value 64
  583.          64 bytes   Length of each pattern (0-64)
  584.           4 bytes   the string "SEQU"
  585.           4 bytes   Value 128
  586.         128 bytes   pattern number to be played at each position (0-63)
  587.  
  588.        This is followed by a pattern chunk for each defined pattern.
  589.        After that, there is a sample chunk for each of the 36 samples.
  590.  
  591.        Note that such a file can contain more than one module (MUSX chunk)
  592.        but practically it's very rare and not easy to handle...
  593.  
  594.        Such a format for a music module is a bit silly since nearly all
  595.        chunks have a constant length.
  596.    
  597. 2.3. Archimedes Symphony Module/Song Format
  598.      --------------------------------------
  599.      Such tunes are composed of a list of positions which refer to the
  600.      pattern that has to be played through a given channel at that song
  601.      position. It's possible to play nothing instead of a pattern.
  602.  
  603.      The ranges are as follows:
  604.      --------------------------
  605.      Voices: 1 to 8
  606.      Tune length: 0 to 4096 (&1000)
  607.      Pattern number: 0 to 4095 (&FFF)
  608.      
  609.      A pattern is composed of 64 notes.
  610.  
  611.      Each note is stored as 4 bytes (A 32 bit-word), and of course all notes
  612.      are stored after each other.
  613.  
  614.      Position Notes data
  615.      -------- ----------
  616.         00      chan i
  617.         01      chan i
  618.         02      chan i
  619.        etc.
  620.      
  621.      Info for each note:
  622.      -------------------
  623.      bits 20-31: effect value (0-4095).
  624.           14-19: effect command number (0-63).
  625.           13-13: not used for now (should be 0).
  626.            6-12: sample number (0-63).
  627.            0- 5: note number (0-36).
  628.  
  629.      Note numbers table:
  630.      -------------------
  631.        C-1 to B-1 : 01 to 12
  632.        C-2 to B-2 : 13 to 24
  633.        C-3 to B-3 : 25 to 36
  634.  
  635.      Note: the use of [x,y] in the following specs refers to the revision
  636.            number x and file version y in which the feature first appeared
  637.            (see top of this file)
  638.      Note2: Any program that would like to read Symphony files should test
  639.             the version number and give an error if greater or equal to 10.
  640.             The difference between version 0 and 1 is that a version 1 file
  641.             MAYBE uses the new packing methods as standard. So read the file
  642.             and check if you know the packing methods used.
  643.      Note3: You may notice that the space taken by a soundtrack can be
  644.             computed without reading the whole file.
  645.  
  646.      Sample file format (Filetype &10A: SySample)
  647.      --------------------------------------------
  648.        Field length Contents
  649.        ------------ --------
  650.           8 bytes   The string "BASSSAMP". Byte value= ASCII code - 64
  651.           1 byte    Version number (currently 1)
  652.           1 byte    Name length: xx
  653.          xx bytes   Name
  654.           3 bytes   Length DIV 2 (length= number of samples, not bytes)
  655.           3 bytes   Repeat offset DIV 2
  656.           3 bytes   Repeat length DIV 2
  657.           1 byte    Packing method
  658.          sy bytes   Data:
  659.                     Packing=0 : 8-bit logarithmic (sy=length)
  660.                     Packing=1 : 13-bit LZW applied to linear sample data
  661.                                 differences (sy multiple of 4)
  662.                     Packing=2 : 8-bit linear signed (sy=length)       [1,0]
  663.                     Packing=3 : 16-bit linear signed (sy=length*2)    [2,1]
  664.                                 (little endian)
  665.                     Packing=4 : SigmaDelta compression applied to     [2,1]
  666.                                 linear sample differences
  667.                     Packing=5 : SigmaDelta compression applied to     [2,1]
  668.                                 logarithmic sample differences
  669.         0-3 bytes   Zero's to fill last file word
  670.  
  671.      Pattern file format (Filetype &FFD: Data)
  672.      -----------------------------------------
  673.        Field length Contents
  674.        ------------ --------
  675.           8 bytes   The string "BASSPTRN". Byte value= ASCII code - 64
  676.           1 byte    Version number (currently 0)
  677.           1 byte    Contents: 0 for a sequence, 1 for some patterns
  678.         0-1 byte    Number of sequence lines (only if Contents=0): z
  679.           2 bytes   Length: number of sequence positions
  680.                     or number of patterns: xx
  681.          yy bytes   Data:
  682.                     Contents=0 : For each line
  683.                                      For xx positions
  684.                                          Pattern number (2 bytes each)
  685.                                  (yy=2*xx*z)
  686.                     Contents=1 : patterns data (yy=256*xx)
  687.  
  688.      Module/Song file format (Filetype &10B: Symphony)
  689.      -------------------------------------------------
  690.        Field length Contents
  691.        ------------ --------
  692.           8 bytes   The string "BASSTRAK". Byte value= ASCII code - 64
  693.           1 byte    Version number (currently 1)
  694.           1 byte    Number of voices (1 to 8): z
  695.           2 bytes   Track length in positions: y (0 to &1000)
  696.           2 bytes   Number of defined patterns: p (0 to &1000)
  697.           3 bytes   Information text length: il
  698.  
  699.           For the 63 samples, we have:
  700.  
  701.        (  1 byte    Sample name length: sn
  702.        (            (bit 7 set if all its data is blanked: lengths, vol, ft)
  703.        (            (bit 6 reserved => mask out to read / write 0)
  704.        (  3 bytes   Sample length DIV 2 (length= number of samples, not bytes)
  705.  
  706.           1 byte    Track name length: x
  707.           x bytes   Track name
  708.           8 bytes   Effects allowed table. 1 bit per effect (0=no, 1=allowed)
  709.       If y>0 then
  710.         ( 1 byte    Packing system for sequence (0= not packed, 1= packed)
  711.         ( s bytes   Sequence data:
  712.         (           Packing=0 : For each position
  713.         (                           For each voice
  714.         (                               Pattern number (2 bytes)
  715.         (                       (s= 2*y*z)
  716.         (           Packing=1 : 13-bit LZW applied to overall sequence data
  717.         (                       (s multiple of 4)
  718.  
  719.       If p>0 then
  720.         ( For each pk-pattern chunk (all 2000 patterns but the last):
  721.         (       1 byte  Packing system for chunk (0= not packed, 1= packed)
  722.         (       b bytes Pattern data:
  723.         (               Packing=0 : For each pattern
  724.         (                             For each pattern position (0 to 63)
  725.         (                               Full note value (1 word)
  726.         (                           (b= 4*64*pk)
  727.         (               Packing=1 : 13-bit LZW applied to chunk data
  728.         (                           (b multiple of 4)
  729.  
  730.           For the 63 samples, we have:
  731.  
  732.        ( sn bytes   Sample name
  733.        (  3 bytes   Sample repeat offset DIV 2
  734.        (  3 bytes   Sample repeat length DIV 2
  735.        (  1 byte    Sample volume (0 to 64)
  736.        (  1 byte    Sample fine tune (-8 to 7)
  737.        (  1 byte    Packing system for sample (see sample file format)
  738.        (
  739.        ( If sample length>0 then
  740.        (   ( sy bytes Data: see sample file format above
  741.  
  742.       If il>0 then
  743.         ( 1 byte    Packing system for information text
  744.         (           (0= not packed, 1= packed)
  745.         ( i bytes   Information text:
  746.         (           Packing=0 : Text (i=il)
  747.         (           Packing=1 : 13-bit LZW applied to information text
  748.         (                       (i multiple of 4)
  749.  
  750.         0-3 bytes   Zero's to fill last file word
  751.  
  752.  
  753.     Notes about compression algorithms:
  754.  
  755.     - Sample differences are computed like this:
  756.       Init: x=0; p=sample start
  757.       Loop: difference= value(p)-x; x= value(p); inc(p)
  758.     - The 13-bit LZW compression scheme uses 256/257 as restart/end code.
  759.       Applied on signed linear sample deltas.
  760.     - The SigmaDelta compression is rather too complex to explain here!
  761.       Applied on unsigned linear or unsigned logarithmic sample deltas.
  762.  
  763.     Maybe next time we'll provide some algorithms...
  764.     
  765.  
  766.         =========================================================
  767.         PART II : Digital Symphony SWI's and commands information
  768.         =========================================================
  769.  
  770. The following explains the functionalities used in the 1 music-player module
  771. (the one generated by the Digital Symphony application) and in the
  772. multi music player module (files DSymPlay and DSymPlayA3). The file DSymPlayA3
  773. only differs from the file DSymPlay in that only the routines used whenever
  774. a cached processor (e.g. ARM3) is detected are present in it, so you gain
  775. some Kbytes space (~16K) but have slower routines when used with non-cached
  776. processors (e.g. ARM2, ARM250).
  777.  
  778. THESE MODULES ARE FREEWARE. If you use it in a NON COMMERCIAL program (we
  779. strongly encourage it) then all we ask is:
  780.   - In all cases, give some credits to BASS for the playroutine.
  781.   - If the play module stays as a stand-alone module in your app directory,
  782.     then include this text file unaltered too.
  783. If you wish to use them in some commercial software then contact
  784. Oregan Developments for an agreement. See the end of this file for addresses.
  785.  
  786. Now more technical details.
  787.  
  788. In order to keep the code size low and the whole CLI command names clean, this
  789. player only offers SWI's. But hopefully a CLI command gives access directly
  790. to these SWI's for the CLI user.
  791.  
  792. Nearly all SWI's should never be used while interrupting the player routine
  793. (i.e. they're not reentrant). See the SWI that allows to know if the player
  794. routine has been interrupted or not.
  795.  
  796. You can call a SWI via this * command:
  797.  
  798.   *DSym <SWI name> [<R0 value> [<R1 value> [<...>]]]
  799.  
  800.   Of course you can't get results back this way.
  801.   The unspecified values are set to 0 before calling the corresponding SWI.
  802.  
  803.   A value may be:
  804.     - Any string readable by the OS_ReadUnsigned SWI (see the PRM's).
  805.     - The latter string preceeded by the minus sign for a negative number.
  806.   You can specify a pointer to a string (i.e. when a file name is required)
  807.   only for R0 value: just put the string between quotes.
  808.  
  809. Some examples:
  810.   Set the overall volume to 64: *DSym Vol 64
  811.   Load file $.MegaMix: *DSym Load "$.MegaMix"
  812.   Set stereo of channel 2 to -127: *DSym Stereo 2 -&7F
  813.  
  814. Instead of installing the player module in RMA (that requires to ensure
  815. there's enough memory free in RMA, very annoying in demos), you could
  816. directly patch the module into your code. There are 2 ways to do this:
  817.  
  818.  - Link it to modules chain in RMA using OS_Module 10 (See the PRM's). The
  819.    SWI's are always available. Don't forget to kill it before returning to
  820.    desktop!
  821.  
  822.  - Don't link to other modules. The SWI's are not directly available.
  823.    Let's assume ModStart to be the start address of the player module in
  824.    your code. First you must call (ModStart+(ModStart!4)) like RISC OS
  825.    would do when loading a module. Now you can use SWI's by calling a
  826.    special routine with R11 containing the SWI number. For example, set the
  827.    volume to 64 with:
  828.  
  829.                MOV R0,#64        ; SWI parameter
  830.                MOV R11,#2        ; SWI number
  831.                BL  ModStart+44   ; Note: need NOT be in SVC mode
  832.  
  833.    Finally don't forget to call (ModStart+(ModStart!8)) before your
  834.    program exits.
  835.  
  836.  
  837. The advantages of using a generated 1 music-player are as follows:
  838.   - Only the useful routines are included. E.g. the rather big loader routine
  839.     is not included.
  840.   - The tune data is arranged to get more efficient results through
  841.     compaction. In fact, samples are stored as linear deltas.
  842.   - Several parameters can be set by default at module installation, such as
  843.     looping, play or not when module installed...
  844.  
  845. Also an advantage in the multi music-player from version 1.40 on:
  846.     At module's installation (or song loading for the multi-player), the
  847.     samples data are scaled to the current configured volume of the machine.
  848.     This gives more chances that the efficient sound buffer filling routines
  849.     in the case of no scaling are used. It's of no help if the global volume
  850.     is not at maximum or a sample is not played at full volume.
  851.     WARNING here: when using the InstrData SWI, the newly installed sample
  852.     is scaled too, so avoid calling twice with exactly the same parameters
  853.     without refreshing the real sample data!
  854.  
  855. The SWI's allow you to play tunes in your own programs and making sound
  856. effects. While the tune is playing you can make additional sound effects
  857. (produce 'custom notes') in the same way the tune does. In fact, you could
  858. play a tune by producing notes stored in your own tables.
  859. If you'd like to play your notes while the tune is playing, you can do it
  860. on the voices used by the tune, but with some tunes there can be some clashes
  861. with samples and notes (this is ONLY a matter of nice sound and NOT a matter
  862. of bugged routines). So it's preferable to play them on the free voices
  863. (the ones with the highest numbers). For example, with a tune with 3 rows
  864. in its sequence and 4 configured voices, you could safely play your notes on
  865. the 4th voice.
  866.  
  867. Useful example:
  868. ---------------
  869. Prototype for playing a song in a usual program:
  870.  
  871.     SYS"DSym_Load","<Prog$Dir>.Music" :REM Load song in RMA
  872.     SYS"DSym_RestartSong"             :REM Start playing
  873.     REPEAT
  874.     REM Main loop
  875.     UNTIL exit%
  876.     FOR v%=64 TO 0 STEP -1            :REM Fade out
  877.       SYS"DSym_Vol",v%
  878.       WAIT
  879.     NEXT
  880.     *RMKill DSymphonyPlayer
  881.  
  882. To stop a tune: SYS"DSym_Pause"
  883. To continue after a stop: SYS"DSym_TuneControl",1 or SYS"DSym_RestartSong" to
  884. restart.
  885.  
  886. Some other possible effects:
  887.   - Engine noises, changing volume and finetune (see effects 11 & 12).
  888.   - Manipulate a lot of samples without loading new tunes, using the InstrData
  889.     SWI.
  890.   - ...
  891.  
  892. More technical details:
  893. -----------------------
  894. SWI Chunk name: DSym
  895. SWI Chunk base number: &45880 (allocated from Acorn)
  896.  
  897. Should work on A5000's and some VIDC enhancers (i.e. no pitch bending)
  898. without any additional code. See SWI to set hardware speed.
  899.  
  900. SWI DSym_Load does not work in the 1 music-player.
  901.  
  902. The player can only load Digital Symphony format files because it would eat
  903. too much memory (makes me think of other players...). It was designed to
  904. be as 'simple' as possible. It cannot read 16-bit samples.
  905.  
  906. The player does NOT use the VIDC pointer.
  907.  
  908. The player does NOT use WAIT's.
  909.  
  910. The player does use OS_ReadMonotonicTime only:
  911.   - When calling DSym_Configure, DSym_Load or the module finalisation entry.
  912.   - In the buffer filling routine when in 'auto speed' mode (in order to
  913.     'guess' the current VIDC speed) (see SWI HardSpeed)
  914. So let the interrupt for the corresponding timer enabled in those cases.
  915.  
  916. The FillAddress SWI allows you to know the address of the buffer filling
  917. routine (you could get it with Sound_Configure but it's easier here).
  918. If you feel pretty good you could then call it yourself instead of RISC OS
  919. each time a sound interrupt occurs. You must call DSym_Configure at least
  920. once before using the filling routine.
  921.  
  922. The specs for the filling routine:
  923.  
  924.    Entry: R12 points to buffer to fill (word-aligned, length=1664 bytes)
  925.           Processor in IRQ mode
  926.           IRQ disabled
  927.    Exit:  R0-R12,R14 and flags corrupted
  928.           Processor in IRQ mode
  929.           IRQ disabled
  930.           Buffer filled for the number of configured voices (208 bytes/voice)
  931.    The routine enables IRQ's during its work.
  932.  
  933. You are expected to make no mistakes when passing parameters to SWI's. If
  934. you do, it's possible that the machine locks up! (Remember: the player is
  935. powerful but simple)
  936.  
  937. Note: There are two SWI's to set the stereo positions. A front-end
  938.       application that sets the current stereo should set the DEFAULT stereo
  939.       too.
  940. Note2: In the following specs, no reference to a register on exit means
  941.        it is preserved.
  942. Note3: It is recommended that you set the sample quality (SampleRate SWI)
  943.        to something other than the default 24. 24 is usually not convenient
  944.        when CPU power is needed for other things than music. This is
  945.        especially true if it has to run on an ARM2.
  946. Note4: The terms 'custom note buffer' and '1-entry-per-voice buffer' used
  947.        below refer to the buffer used to store notes triggered by some SWI's
  948.        below before they are really played by the interrupt routine. Two
  949.        notes played just one after each other probably means that only the
  950.        lastest one will be taken into account. Some SWI's allow to solve that
  951.        problem by controlling the empty state of the buffer.
  952.  
  953. +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  954. SWI name         Nr !Entry                     !Exit/Effect
  955. +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  956. Load             00 !R0=-1 to free RMA buffers !If an error occured, then
  957.                     !or R0= 0 to load from     !   R0 points to error        
  958.                     !         memory           !   and V is set,
  959.                     !or R0 points to file name !else
  960.                     !R1= source start address  !   R0= length of track
  961.                     !    (if R0=0)             !       in memory.
  962.                     !R2= 0 to load to RMA      !
  963.                     !or R2= destination start  !
  964.                     !       address            !
  965.                     !R3= size of destination   !
  966.                     !    buffer (if R2<>0)     !
  967.                     !R4= 0 to claim buffer     !
  968.                     !    in RMA                !
  969.                     !or R4= start address of   !
  970.                     !   buffer (32K space)     !
  971.                     !A buffer address is needed only if the Symphony file
  972.                     ! contains some packed data.
  973.                     !Buffers are word aligned.
  974.                     !In the case of packed data, the source and destination
  975.                     ! buffers can't share any part of memory.
  976.                     !In the case of entirely non packed data, the two buffers
  977.                     ! can share a part of memory provided
  978.                     ! destination address <= source address. After the call
  979.                     ! the source data has been altered because the
  980.                     ! module needs to build an internal structure different
  981.                     ! to the source structure of the tune.
  982.                     !Although the code is quite optimized, loading from
  983.                     ! memory may take some time because all the data has to
  984.                     ! be moved in memory. So don't expect loading 50 songs
  985.                     ! per second with an ARM2!
  986. --------------------+--------------------------+-----------------------------
  987. RestartSong      01 ! -                        !Do a ResetParams,
  988.                     !                          !Tune position set to (0,0),
  989.                     !                          !Tune playing again.
  990. --------------------+--------------------------+-----------------------------
  991. Vol              02 !R0= new overall volume    !R0= previous overall volume
  992.                     !    or -1 to read         !    (0-64).
  993.                     !Initial value is 64       !
  994. --------------------+--------------------------+-----------------------------
  995. Stereo           03 !R0= voice number (0-7)    !R1= previous stereo position
  996.                     !R1= new stereo position   !    (-127 to 127) for voice
  997.                     !    or -128 to read       !    number R0.
  998.                     !                          !
  999.                     !Initial values are those of the Amiga.
  1000. --------------------+--------------------------+-----------------------------
  1001. CutNote          04 !R0= voice number (0-7)    !R1= previous note state on
  1002.                     !R1>=0 to read state       !    voice number R0
  1003.                     !  < 0 to stop note        !  < 0 -> stopped
  1004.                     !                          !  >=0 -> playing, = sample
  1005.                     !                          !         start address
  1006.                     !                          !If R1>=0 then
  1007.                     !                          !  R2= offset in sample
  1008.                     !                          !      in 1/(2^12) units
  1009. --------------------+--------------------------+-----------------------------
  1010. PlayInstrPacked  05 !R0= voice number (0-7)    !The new note is put into a
  1011.                     !R1= full note data        !1-entry-per-voice buffer to be
  1012.                     !R5= minimum sustain time  !played.
  1013.                     !    (in 1/50th sec)       !Setting a sustain time means
  1014.                     !R6<>0 to wait for buffer  !that the new note has
  1015.                     !      empty               !priority on the tune notes
  1016.                     !      else don't wait     !during this time.
  1017. --------------------+--------------------------+-----------------------------
  1018. PlayInstr        06 !R0= voice number (0-7)    !The new note is put into a
  1019.                     !R1= note number (0-36)    !1-entry-per-voice buffer to be
  1020.                     !R2= sample number (0-63)  !played.
  1021.                     !R3= effect number (0-63)  !Setting a sustain time means
  1022.                     !R4= effect value (0-&FFF) !that the new note has
  1023.                     !R5= minimum sustain time  !priority on the tune notes
  1024.                     !    (in 1/50th sec)       !during this time.
  1025.                     !R6<>0 to wait for buffer  !
  1026.                     !      empty               !
  1027.                     !      else don't wait     !
  1028. --------------------+--------------------------+-----------------------------
  1029. ResetParams      07 ! -                        !All parameters are reset
  1030.                     !                          !(stereo,counters,effects,...)
  1031.                     !                          !and do a FlushOutput.
  1032. --------------------+--------------------------+-----------------------------
  1033. FlushOutput      08 ! -                        !The current notes on all
  1034.                     !                          !channels are cut.
  1035. --------------------+--------------------------+-----------------------------
  1036. FreezeOutput     09 !R0= -1 to read output     !R0= previous output status
  1037.                     !        status            !(  0= off ie. no sound output
  1038.                     !   <>-1 to set            ! <>0= on )
  1039. --------------------+--------------------------+-----------------------------
  1040. UpCallVector     0A !R0= -1 to read upcall     !R0= previous upcall address
  1041.                     !       address            !
  1042.                     !  = -2 to set default     !
  1043.                     !  else new address        !
  1044. --------------------+--------------------------+-----------------------------
  1045. MaskVoice        0B !R0= voice number (0-7)    !R0= previous voice status
  1046.                     !R1= -1 to read voice stat !    (0= off, <>0=on)
  1047.                     !  <>-1 to set voice status!The notes are still played
  1048.                     !                          !but not heard for the voice.
  1049. --------------------+--------------------------+-----------------------------
  1050. SongPos          0C !R0= -1 to read sequence ps!R0= previous sequence pos
  1051.                     !  <>-1 to set             !R1= previous pattern pos
  1052.                     !R1= -1 to read pattern pos!    (0-63)
  1053.                     !  <>-1 to set             !If pattern pos is changed
  1054.                     !                          !then the current counter is
  1055.                     !                          !reset to play the tune line
  1056.                     !                          !as soon as possible.
  1057. --------------------+--------------------------+-----------------------------
  1058. TuneControl      0D !R0= -1 to read status     !R0= previous tune status
  1059.                     !  <>-1 to set (lower byte)!    (0= off, <>0= on)
  1060.                     !                          !Off means the tune decoder
  1061.                     !                          !won't let play notes anymore,
  1062.                     !                          !you can still play custom
  1063.                     !                          !notes.
  1064.                     !                          !Current notes still playing.
  1065. --------------------+--------------------------+-----------------------------
  1066. Pause            0E ! -                        !The tune is stopped and
  1067.                     !                          !current notes on tune
  1068.                     !                          !channels cut.
  1069. --------------------+--------------------------+-----------------------------
  1070. Voices           0F !R0= -1 to read hardware   !R0= previous hardware voices
  1071.                     !       voices number      !    number (1,2,4 or 8)
  1072.                     !  <>-1 to set voices      !
  1073.                     !The change is taken into account during next configure.
  1074.                     !Initial value is 4.
  1075. --------------------+--------------------------+-----------------------------
  1076. Wait             10 !R0= voice number (0-7)    !C is set if custom note
  1077.                     !                          !buffer is not empty,
  1078.                     !                          !else clear.
  1079. --------------------+--------------------------+-----------------------------
  1080. IntState         11 ! -                        !C is set if the call has
  1081.                     !                          !interrupted the playing or
  1082.                     !                          !filling routines.
  1083. --------------------+--------------------------+-----------------------------
  1084. NoteInfo         12 ! -                        !R0= address of current notes
  1085.                     !                          !    table (1 word per voice)
  1086.                     !                          !    note is 0 to 1023
  1087.                     !                          !R1= address of current
  1088.                     !                          !    samples table (1 byte per
  1089.                     !                          !    voice)
  1090.                     !                          !    sample is 0 to 63
  1091.                     !                          !R2= address of effects table
  1092.                     !                          !    (1 word per voice)
  1093.                     !                          !    bits 30-31 meaningless
  1094.                     !                          !    bits 16-21 effect nr
  1095.                     !                          !    bits  0-11 effect value
  1096.                     !                          !R3= address of volumes table
  1097.                     !                          !    (1 byte per voice)
  1098.                     !                          !    volume is 0 to 64
  1099. --------------------+--------------------------+-----------------------------
  1100. VuBar            13 !R0= voice number (0-7)    !R1= Vu bar height (0-64)
  1101. --------------------+--------------------------+-----------------------------
  1102. Loop             14 !R0= -1 to read loop contrl!R0= previous loop control
  1103.                     !  <>-1 to set             !    (  0= enabled,
  1104.                     !R1= -1 to read loop flag  !     <>0= disabled )
  1105.                     !  <>-1 to set             !R1<>0 if the tune has looped
  1106.                     !                          !      else not looped
  1107.                     !                          !
  1108.                     !Loop control is initially enabled.
  1109.                     !If a song has looped and the loop is disabled, you can
  1110.                     !continue playing using TuneControl.
  1111. --------------------+--------------------------+-----------------------------
  1112. BufferAddress    15 ! -                        !R0= current system hardware
  1113.                     !                          !    buffer address (with
  1114.                     !                          !    output data interleaved)
  1115.                     !                          !    208 bytes per channel
  1116. --------------------+--------------------------+-----------------------------
  1117. VuGravity        16 !R0= -1 to read Vu gravity !R0= previous gravity of Vu
  1118.                     !  <>-1 to set (lower byte)!    bars (0-255)
  1119.                     !Initial value is 2.       !
  1120.                     !The change is taken into account during next configure.
  1121. --------------------+--------------------------+-----------------------------
  1122. SampleRate       17 !R0= -1 to read sample rate!R0= previous sample rate
  1123.                     !  <>-1 to set             !    (0-99) - determines
  1124.                     !                          !    sample output density.
  1125.                     !Original value is 24.     !
  1126.                     !The change is taken into account during next configure.
  1127. --------------------+--------------------------+-----------------------------
  1128. Configure        18 !R0= -1 to reinstall previous
  1129.                     !       configuration      
  1130.                     !  <>-1 to configure the system
  1131.                     !       with new voices number,
  1132.                     !       sample rate, Vu gravity and hardware speed.
  1133. --------------------+--------------------------+-----------------------------
  1134. Params           19 !                          !R0= speed (1-&FFF)
  1135.                     !                          !R1= tempo (1-&FFF)
  1136.                     !                          !R2= counter (0-&FFE)
  1137.                     !The counter varies from 1 to speed-1 at a speed
  1138.                     !according to tempo (50 times a sec for default tempo)
  1139. --------------------+--------------------------+-----------------------------
  1140. TuneInfo         1A ! -                        !R0= tune length
  1141.                     !                          !R1= number of patterns
  1142. --------------------+--------------------------+-----------------------------
  1143. PlaySingle       1B !   R0= -1                 !   Play pattern R1
  1144.                     ! or                       ! or
  1145.                     !   R0<>-1                 !   Play from pos R0 to R1
  1146.                     !                          !
  1147.                     ! and                      !
  1148.                     !   R2= -1 for no loop     !
  1149.                     !     <>-1 to loop         !
  1150.                     !                          !
  1151.                     ! or R0=-1 and R1=-1       ! or Normal play.
  1152.                     !                          !
  1153.                     !                          !The pattern pos is set to 0.
  1154.                     !                          !In the case of playing a
  1155.                     !                          !part of the sequence, the
  1156.                     !                          !current position is set to
  1157.                     !                          !the first pos in that part.
  1158. --------------------+--------------------------+-----------------------------
  1159. DefaultStereo    1C !R0= voice number (0-7)    !R1= previous default stereo
  1160.                     !R1= new default stereo    !position (1 to 7) for
  1161.                     !    position              !voice number R0
  1162.                     !    or 0 to read          !
  1163.                     !                          !
  1164.                     !Initial values are those of the Amiga.
  1165. --------------------+--------------------------+-----------------------------
  1166. InstrData        1D !R0= sample number (1-63)  !The specs for sample R0
  1167.                     !R1= sample data address   !are changed to those on entry
  1168.                     !    or -1 to read         !R1= previous address
  1169.                     !R2= sample length         !R2= previous length
  1170.                     !    or -1 to read         !R3= previous repeat offset
  1171.                     !R3= repeat offset         !R4= previous repeat length
  1172.                     !    or -1 to read         !R5= previous volume
  1173.                     !R4= repeat length         !R6= previous finetune
  1174.                     !    or -1 to read         !    (-8 to 7)
  1175.                     !R5= volume (0-64)         !
  1176.                     !    or -1 to read         !
  1177.                     !R6= finetune (0-&F)       !
  1178.                     !    or -1 to read         !
  1179.                     !R1 to R4 must be 2-byte aligned.
  1180.                     !Put a repeat length of 0 for no repeats.
  1181.                     !Repeat length can't be 2.
  1182.                     !Set bit 31 of R1 if the sample is signed linear.
  1183.                     !The data is not moved i.e. it stays where you put it.
  1184.                     !The data is also scaled to the current machine volume if
  1185.                     !R1<>-1.
  1186. --------------------+--------------------------+-----------------------------
  1187. HardSpeed        1E !R0= samples output        !R0= previous parameter
  1188.                     !    frequency (in kHz)    !R1= current hardware speed
  1189.                     !    or 0 for 'auto speed' !    (in kHz)
  1190.                     !    or -1 to read         !The buffer filling routine
  1191.                     !                          !output frequency is changed
  1192.                     !                          !to the one on entry
  1193.                     !Initial mode is 24000     !
  1194.                     !The change is taken into account during next configure.
  1195.                     !
  1196.                     !In 'auto speed' mode, the filling routine will try to
  1197.                     !guess the current VIDC frequency for outputting samples
  1198.                     !by averaging the number of calls to it and adjust its
  1199.                     !tables to always have the same real pitch whatever the
  1200.                     !hardware speed is. The 'auto speed' selects one of the
  1201.                     !three following speeds currently:
  1202.                     !
  1203.                     !    24000 kHz (normal modes)
  1204.                     !    25175 kHz (VGA modes)
  1205.                     !    36000 kHz (multi sync modes)
  1206.                     !
  1207.                     !Too bad to have the same clock for graphics and sound!
  1208. --------------------+--------------------------+-----------------------------
  1209. LoopType         1F !R0= loop type             !R0= previous loop type
  1210.                     !   or -1 to read          !    (0 or 1)
  1211.                     !                          !
  1212.                     !Type 0: The loop flag is set if the tune reaches
  1213.                     !        position 0.
  1214.                     !Type 1: The loop flag is set if the tune jumps to
  1215.                     !        a lower position.
  1216. --------------------+--------------------------+-----------------------------
  1217. FillAddress      20 ! -                        !R0= address of buffer filling
  1218.                     !                          !    routine
  1219. --------------------+--------------------------+-----------------------------
  1220.  
  1221. So, with such a tool in the hands of (good) demo and game writers, we hope
  1222. to see more and more demos and games with decent (if not very good) sound,
  1223. and never listen again to the horrible *noises* made by previous (and some
  1224. current) lamer samples and SoundTrackers replayers!!!
  1225.  
  1226. Before giving our addresses, we'd like to thank the following people/groups
  1227. for their constructive remarks and questions and bug reports concerning
  1228. this player:
  1229.  
  1230.                                  SICK
  1231.  
  1232.                                ARMAXESS
  1233.  
  1234.                             George Saliaris
  1235.  
  1236.  
  1237. If you find any bug or have any comment about this player or even Digital
  1238. Symphony, don't hesitate to contact us at one of the addresses below:
  1239.  
  1240.         +----------------------------------------------------------------+
  1241.         !       You can contact the guys who made this software at       !
  1242.         +--------------------------+-------------------------------------+
  1243.         !    Bernard Jungen        !    Gil Damoiseaux                   !
  1244.         !    Friddericht 27        !    Rue du Bois des Broux 5          !
  1245.         !    B-6706 Autelbas       !    B-5080 Rhisnes                   !
  1246.         !    Belgium               !    Belgium                          !
  1247.         !                          !                                     !
  1248.         ! E-mail (until end 1999): !                                     !
  1249.         !    bju@cediti.be         !                                     !
  1250.         +--------------------------+-------------------------------------+
  1251.  
  1252.                       +----------------------------------+
  1253.                       ! John Tytgat                      !
  1254.                       ! Brusselbaan 445                  !
  1255.                       ! B-1600 St.-Pieters-Leeuw         !
  1256.                       ! Belgium                          !
  1257.                       !                                  !
  1258.                       ! E-mail:                          !
  1259.                       !  john.tytgat@barco.be            !
  1260.                       +----------------------------------+
  1261.  
  1262. If you would like to use our play routines in commercial products, or simply
  1263. want to buy Digital Symphony itself, then contact:
  1264.  
  1265.    +-------------------------------------------------------------------+
  1266.    ! You can obtain a fully multi-tasking sound tracker editor, called !
  1267.    ! Digital Symphony, which takes ProTracker, (Octo)MED, Tracker,     !
  1268.    !        Coconizer and native Symphony files as input from          !
  1269.    +-------------------------------------------------------------------+
  1270.    !                      Oregan Developments,                         !
  1271.    !                  36 Grosvenor Avenue, Streetly,                   !
  1272.    !                   Sutton Coldfield B74 3PE,                       !
  1273.    !                           England.                                !
  1274.    +-------------------------------------------------------------------+
  1275.  
  1276. © 1992/1996 B. Jungen & G. Damoiseaux (members of BASS).
  1277.